package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: atp
 * Date: 2022-10-30
 * Time: 15:57
 */
abstract class Shape {
    public static int a = 10;
    //抽象方法 没有具体实现
    public abstract void draw();
    public void func() {

    }
}
class Rect extends Shape {
    //继承后重写抽象方法
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}

public class Test1 {
    public static void main2(String[] args) {
        Shape shape = new Rect();
    }
}
